#include <iostream>
#include <cstring>
using namespace std;

/*
	子类大小=父类+子类所有成员变量的和，也要满足字节对齐
*/
class Animal
{
public:
	void eat()
	{
		cout<<"动物吃"<<endl;
	}
	int age;
private:
	void sleep()
	{
		cout<<"动物睡觉"<<endl;
	}
	float weight;
protected:
	void run()
	{
		cout<<"动物跑步"<<endl;
	}
	int color;
};
class Cat:public Animal
{
public:

private:
	double n;
};

int main(int argc,char **argv)
{
	Cat c1;
	cout<<"子类猫的大小: "<<sizeof(Cat)<<endl;
	
	return 0;	
}